<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE FlexibleInstances     #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE MultiParamTypeClasses #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE OverloadedStrings     #-}</span><span>
</span><span id="line-4"></span><span class="hs-pragma">{-# LANGUAGE ScopedTypeVariables   #-}</span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wall -Werror #-}</span><span>
</span><span id="line-6"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Distribution.Parsec.FieldLineStream</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-7"></span><span>    </span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#FieldLineStream"><span class="hs-identifier">FieldLineStream</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-8"></span><span>    </span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamFromString"><span class="hs-identifier">fieldLineStreamFromString</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-9"></span><span>    </span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamFromBS"><span class="hs-identifier">fieldLineStreamFromBS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>    </span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamEnd"><span class="hs-identifier">fieldLineStreamEnd</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>    </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Bits.html#"><span class="hs-identifier">Data.Bits</span></a></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span>             </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier">ByteString</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Compat.Prelude.html"><span class="hs-identifier">Distribution.Compat.Prelude</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Distribution.Utils.Generic.html"><span class="hs-identifier">Distribution.Utils.Generic</span></a></span><span>  </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Utils.Generic.html#toUTF8BS"><span class="hs-identifier">toUTF8BS</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Prelude.html#"><span class="hs-identifier">Prelude</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.html#"><span class="hs-identifier">Data.ByteString</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">BS</span></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../parsec/src/Text.Parsec.html#"><span class="hs-identifier">Text.Parsec</span></a></span><span>     </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Parsec</span></span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span class="hs-comment">-- | This is essentially a lazy bytestring, but chunks are glued with newline @\'\\n\'@.</span><span>
</span><span id="line-23"></span><span class="hs-keyword">data</span><span> </span><span id="FieldLineStream"><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#FieldLineStream"><span class="hs-identifier hs-var">FieldLineStream</span></a></span></span><span>
</span><span id="line-24"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="FLSLast"><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#FLSLast"><span class="hs-identifier hs-var">FLSLast</span></a></span></span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span>
</span><span id="line-25"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span id="FLSCons"><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#FLSCons"><span class="hs-identifier hs-var">FLSCons</span></a></span></span><span> </span><span class="hs-pragma">{-# UNPACK</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="hs-glyph">!</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#FieldLineStream"><span class="hs-identifier hs-type">FieldLineStream</span></a></span><span>
</span><span id="line-26"></span><span>  </span><span class="hs-keyword">deriving</span><span> </span><span id="local-6989586621679620749"><span id="local-6989586621679620751"><span id="local-6989586621679620760"><span class="annot"><span class="annottext">Int -&gt; FieldLineStream -&gt; ShowS
[FieldLineStream] -&gt; ShowS
FieldLineStream -&gt; String
(Int -&gt; FieldLineStream -&gt; ShowS)
-&gt; (FieldLineStream -&gt; String)
-&gt; ([FieldLineStream] -&gt; ShowS)
-&gt; Show FieldLineStream
forall a.
(Int -&gt; a -&gt; ShowS) -&gt; (a -&gt; String) -&gt; ([a] -&gt; ShowS) -&gt; Show a
showList :: [FieldLineStream] -&gt; ShowS
$cshowList :: [FieldLineStream] -&gt; ShowS
show :: FieldLineStream -&gt; String
$cshow :: FieldLineStream -&gt; String
showsPrec :: Int -&gt; FieldLineStream -&gt; ShowS
$cshowsPrec :: Int -&gt; FieldLineStream -&gt; ShowS
</span><a href="../../base/src/GHC.Show.html#Show"><span class="hs-identifier hs-var hs-var hs-var hs-var hs-var hs-var hs-var hs-var">Show</span></a></span></span></span></span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamEnd"><span class="hs-identifier hs-type">fieldLineStreamEnd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#FieldLineStream"><span class="hs-identifier hs-type">FieldLineStream</span></a></span><span>
</span><span id="line-29"></span><span id="fieldLineStreamEnd"><span class="annot"><span class="annottext">fieldLineStreamEnd :: FieldLineStream
</span><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamEnd"><span class="hs-identifier hs-var hs-var">fieldLineStreamEnd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FieldLineStream
</span><a href="Distribution.Parsec.FieldLineStream.html#FLSLast"><span class="hs-identifier hs-var">FLSLast</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
forall a. Monoid a =&gt; a
</span><a href="../../base/src/GHC.Base.html#mempty"><span class="hs-identifier hs-var">mempty</span></a></span><span>
</span><span id="line-30"></span><span>
</span><span id="line-31"></span><span class="hs-comment">-- | Convert 'String' to 'FieldLineStream'.</span><span>
</span><span id="line-32"></span><span class="hs-comment">--</span><span>
</span><span id="line-33"></span><span class="hs-comment">-- /Note:/ inefficient!</span><span>
</span><span id="line-34"></span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamFromString"><span class="hs-identifier hs-type">fieldLineStreamFromString</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#FieldLineStream"><span class="hs-identifier hs-type">FieldLineStream</span></a></span><span>
</span><span id="line-35"></span><span id="fieldLineStreamFromString"><span class="annot"><span class="annottext">fieldLineStreamFromString :: String -&gt; FieldLineStream
</span><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamFromString"><span class="hs-identifier hs-var hs-var">fieldLineStreamFromString</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FieldLineStream
</span><a href="Distribution.Parsec.FieldLineStream.html#FLSLast"><span class="hs-identifier hs-var">FLSLast</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; FieldLineStream)
-&gt; (String -&gt; ByteString) -&gt; String -&gt; FieldLineStream
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; ByteString
</span><a href="Distribution.Utils.Generic.html#toUTF8BS"><span class="hs-identifier hs-var">toUTF8BS</span></a></span><span>
</span><span id="line-36"></span><span>
</span><span id="line-37"></span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamFromBS"><span class="hs-identifier hs-type">fieldLineStreamFromBS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#FieldLineStream"><span class="hs-identifier hs-type">FieldLineStream</span></a></span><span>
</span><span id="line-38"></span><span id="fieldLineStreamFromBS"><span class="annot"><span class="annottext">fieldLineStreamFromBS :: ByteString -&gt; FieldLineStream
</span><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamFromBS"><span class="hs-identifier hs-var hs-var">fieldLineStreamFromBS</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FieldLineStream
</span><a href="Distribution.Parsec.FieldLineStream.html#FLSLast"><span class="hs-identifier hs-var">FLSLast</span></a></span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span id="local-6989586621679620793"><span class="hs-keyword">instance</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679620793"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Prim.html#Stream"><span class="hs-identifier hs-type">Parsec.Stream</span></a></span><span> </span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#FieldLineStream"><span class="hs-identifier hs-type">FieldLineStream</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679620793"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-41"></span><span>    </span><span id="local-6989586621679620738"><span class="annot"><span class="annottext">uncons :: FieldLineStream -&gt; m (Maybe (Char, FieldLineStream))
</span><a href="../../parsec/src/Text.Parsec.Prim.html#uncons"><span class="hs-identifier hs-var hs-var hs-var hs-var">uncons</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#FLSLast"><span class="hs-identifier hs-type">FLSLast</span></a></span><span> </span><span id="local-6989586621679620736"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620736"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Char, FieldLineStream) -&gt; m (Maybe (Char, FieldLineStream))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Char, FieldLineStream)
 -&gt; m (Maybe (Char, FieldLineStream)))
-&gt; Maybe (Char, FieldLineStream)
-&gt; m (Maybe (Char, FieldLineStream))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Maybe (Word8, ByteString)
</span><a href="../../bytestring/src/Data.ByteString.html#uncons"><span class="hs-identifier hs-var">BS.uncons</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620736"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-42"></span><span>        </span><span class="annot"><span class="annottext">Maybe (Word8, ByteString)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe (Char, FieldLineStream)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679620734"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620734"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679620733"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620733"><span class="hs-identifier hs-var">bs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Char, FieldLineStream) -&gt; Maybe (Char, FieldLineStream)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8
-&gt; ByteString
-&gt; (ByteString -&gt; FieldLineStream)
-&gt; FieldLineStream
-&gt; (Char, FieldLineStream)
forall a.
Word8 -&gt; ByteString -&gt; (ByteString -&gt; a) -&gt; a -&gt; (Char, a)
</span><a href="Distribution.Parsec.FieldLineStream.html#unconsChar"><span class="hs-identifier hs-var">unconsChar</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620734"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620733"><span class="hs-identifier hs-var">bs'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679620731"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620731"><span class="hs-identifier hs-var">bs''</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FieldLineStream
</span><a href="Distribution.Parsec.FieldLineStream.html#FLSLast"><span class="hs-identifier hs-var">FLSLast</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620731"><span class="hs-identifier hs-var">bs''</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FieldLineStream
</span><a href="Distribution.Parsec.FieldLineStream.html#fieldLineStreamEnd"><span class="hs-identifier hs-var">fieldLineStreamEnd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span>    </span><span class="annot"><a href="../../parsec/src/Text.Parsec.Prim.html#uncons"><span class="hs-identifier hs-var">uncons</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#FLSCons"><span class="hs-identifier hs-type">FLSCons</span></a></span><span> </span><span id="local-6989586621679620730"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620730"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span id="local-6989586621679620729"><span class="annot"><span class="annottext">FieldLineStream
</span><a href="#local-6989586621679620729"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (Char, FieldLineStream) -&gt; m (Maybe (Char, FieldLineStream))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(Maybe (Char, FieldLineStream)
 -&gt; m (Maybe (Char, FieldLineStream)))
-&gt; Maybe (Char, FieldLineStream)
-&gt; m (Maybe (Char, FieldLineStream))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Maybe (Word8, ByteString)
</span><a href="../../bytestring/src/Data.ByteString.html#uncons"><span class="hs-identifier hs-var">BS.uncons</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620730"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-46"></span><span>        </span><span class="hs-comment">-- as lines are glued with '\n', we return '\n' here!</span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><span class="annottext">Maybe (Word8, ByteString)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Char, FieldLineStream) -&gt; Maybe (Char, FieldLineStream)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FieldLineStream
</span><a href="#local-6989586621679620729"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679620728"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620728"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679620727"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620727"><span class="hs-identifier hs-var">bs'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(Char, FieldLineStream) -&gt; Maybe (Char, FieldLineStream)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8
-&gt; ByteString
-&gt; (ByteString -&gt; FieldLineStream)
-&gt; FieldLineStream
-&gt; (Char, FieldLineStream)
forall a.
Word8 -&gt; ByteString -&gt; (ByteString -&gt; a) -&gt; a -&gt; (Char, a)
</span><a href="Distribution.Parsec.FieldLineStream.html#unconsChar"><span class="hs-identifier hs-var">unconsChar</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620728"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620727"><span class="hs-identifier hs-var">bs'</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679620726"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620726"><span class="hs-identifier hs-var">bs''</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FieldLineStream -&gt; FieldLineStream
</span><a href="Distribution.Parsec.FieldLineStream.html#FLSCons"><span class="hs-identifier hs-var">FLSCons</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620726"><span class="hs-identifier hs-var">bs''</span></a></span><span> </span><span class="annot"><span class="annottext">FieldLineStream
</span><a href="#local-6989586621679620729"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FieldLineStream
</span><a href="#local-6989586621679620729"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span class="hs-comment">-- Based on implementation 'decodeStringUtf8'</span><span>
</span><span id="line-51"></span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#unconsChar"><span class="hs-identifier hs-type">unconsChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-keyword">forall</span><span> </span><span id="local-6989586621679620786"><span class="annot"><a href="#local-6989586621679620786"><span class="hs-identifier hs-type">a</span></a></span></span><span class="hs-operator">.</span><span> </span><span class="annot"><a href="../../base/src/GHC.Word.html#Word8"><span class="hs-identifier hs-type">Word8</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679620786"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679620786"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679620786"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span id="unconsChar"><span class="annot"><span class="annottext">unconsChar :: forall a.
Word8 -&gt; ByteString -&gt; (ByteString -&gt; a) -&gt; a -&gt; (Char, a)
</span><a href="Distribution.Parsec.FieldLineStream.html#unconsChar"><span class="hs-identifier hs-var hs-var">unconsChar</span></a></span></span><span> </span><span id="local-6989586621679620657"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span></span><span> </span><span id="local-6989586621679620656"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620656"><span class="hs-identifier hs-var">bs0</span></a></span></span><span> </span><span id="local-6989586621679620655"><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679620655"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679620654"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679620654"><span class="hs-identifier hs-var">next</span></a></span></span><span>
</span><span id="line-53"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x7F</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="../../base/src/GHC.Char.html#chr"><span class="hs-identifier hs-var">chr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679620655"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620656"><span class="hs-identifier hs-var">bs0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-54"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0xBF</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="Distribution.Parsec.FieldLineStream.html#replacementChar"><span class="hs-identifier hs-var">replacementChar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679620655"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620656"><span class="hs-identifier hs-var">bs0</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0xDF</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Char, a)
</span><a href="#local-6989586621679620650"><span class="hs-identifier hs-var">twoBytes</span></a></span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0xEF</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ByteString -&gt; Int -&gt; (Char, a)
</span><a href="#local-6989586621679620649"><span class="hs-identifier hs-var">moreBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x800</span></span><span>     </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620656"><span class="hs-identifier hs-var">bs0</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Int) -&gt; Word8 -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Word8
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0xF</span></span><span class="hs-special">)</span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0xF7</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ByteString -&gt; Int -&gt; (Char, a)
</span><a href="#local-6989586621679620649"><span class="hs-identifier hs-var">moreBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x10000</span></span><span>   </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620656"><span class="hs-identifier hs-var">bs0</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Int) -&gt; Word8 -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Word8
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x7</span></span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0xFB</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ByteString -&gt; Int -&gt; (Char, a)
</span><a href="#local-6989586621679620649"><span class="hs-identifier hs-var">moreBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">5</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x200000</span></span><span>  </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620656"><span class="hs-identifier hs-var">bs0</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Int) -&gt; Word8 -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Word8
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x3</span></span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0xFD</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ByteString -&gt; Int -&gt; (Char, a)
</span><a href="#local-6989586621679620649"><span class="hs-identifier hs-var">moreBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x4000000</span></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620656"><span class="hs-identifier hs-var">bs0</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">(Word8 -&gt; Int) -&gt; Word8 -&gt; Int
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Word8
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x1</span></span><span class="hs-special">)</span><span>
</span><span id="line-60"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; (Char, a)
forall a. HasCallStack =&gt; String -&gt; a
</span><a href="../../base/src/GHC.Err.html#error"><span class="hs-identifier hs-var">error</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; (Char, a)) -&gt; String -&gt; (Char, a)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;not implemented &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span>
</span><span id="line-61"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-62"></span><span>    </span><span id="local-6989586621679620650"><span class="annot"><span class="annottext">twoBytes :: (Char, a)
</span><a href="#local-6989586621679620650"><span class="hs-identifier hs-var hs-var">twoBytes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Maybe (Word8, ByteString)
</span><a href="../../bytestring/src/Data.ByteString.html#uncons"><span class="hs-identifier hs-var">BS.uncons</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620656"><span class="hs-identifier hs-var">bs0</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-63"></span><span>        </span><span class="annot"><span class="annottext">Maybe (Word8, ByteString)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="Distribution.Parsec.FieldLineStream.html#replacementChar"><span class="hs-identifier hs-var">replacementChar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679620654"><span class="hs-identifier hs-var">next</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679620639"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620639"><span class="hs-identifier hs-var">c1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679620638"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620638"><span class="hs-identifier hs-var">bs1</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620639"><span class="hs-identifier hs-var">c1</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Word8
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0xC0</span></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x80</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-66"></span><span>                </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620637"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x80</span></span><span>
</span><span id="line-67"></span><span>                </span><span class="hs-keyword">then</span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="../../base/src/GHC.Char.html#chr"><span class="hs-identifier hs-var">chr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620637"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679620655"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620638"><span class="hs-identifier hs-var">bs1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span>                </span><span class="hs-keyword">else</span><span>  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="Distribution.Parsec.FieldLineStream.html#replacementChar"><span class="hs-identifier hs-var">replacementChar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679620655"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620638"><span class="hs-identifier hs-var">bs1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-69"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="Distribution.Parsec.FieldLineStream.html#replacementChar"><span class="hs-identifier hs-var">replacementChar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679620655"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620638"><span class="hs-identifier hs-var">bs1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-70"></span><span>          </span><span class="hs-keyword">where</span><span>
</span><span id="line-71"></span><span>            </span><span id="local-6989586621679620637"><span class="annot"><span class="annottext">d :: Int
</span><a href="#local-6989586621679620637"><span class="hs-identifier hs-var hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620657"><span class="hs-identifier hs-var">c0</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Word8
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x1F</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftL"><span class="hs-operator hs-var">`shiftL`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620639"><span class="hs-identifier hs-var">c1</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Word8
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x3F</span></span><span class="hs-special">)</span><span>
</span><span id="line-72"></span><span>
</span><span id="line-73"></span><span>    </span><span class="annot"><a href="#local-6989586621679620649"><span class="hs-identifier hs-type">moreBytes</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../bytestring/src/Data.ByteString.Internal.html#ByteString"><span class="hs-identifier hs-type">ByteString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621679620786"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-74"></span><span>    </span><span id="local-6989586621679620649"><span class="annot"><span class="annottext">moreBytes :: Int -&gt; Int -&gt; ByteString -&gt; Int -&gt; (Char, a)
</span><a href="#local-6989586621679620649"><span class="hs-identifier hs-var hs-var">moreBytes</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span id="local-6989586621679620624"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620624"><span class="hs-identifier hs-var">overlong</span></a></span></span><span> </span><span id="local-6989586621679620623"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620623"><span class="hs-identifier hs-var">bs'</span></a></span></span><span> </span><span id="local-6989586621679620622"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620622"><span class="hs-identifier hs-var">acc</span></a></span></span><span>
</span><span id="line-75"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620624"><span class="hs-identifier hs-var">overlong</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620622"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620622"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x10FFFF</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620622"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0xD800</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0xDFFF</span></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620622"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-76"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Char
</span><a href="../../base/src/GHC.Char.html#chr"><span class="hs-identifier hs-var">chr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620622"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679620655"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620623"><span class="hs-identifier hs-var">bs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-77"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-78"></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="Distribution.Parsec.FieldLineStream.html#replacementChar"><span class="hs-identifier hs-var">replacementChar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679620655"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620623"><span class="hs-identifier hs-var">bs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span>    </span><span class="annot"><a href="#local-6989586621679620649"><span class="hs-identifier hs-var">moreBytes</span></a></span><span> </span><span id="local-6989586621679620619"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620619"><span class="hs-identifier hs-var">byteCount</span></a></span></span><span> </span><span id="local-6989586621679620618"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620618"><span class="hs-identifier hs-var">overlong</span></a></span></span><span> </span><span id="local-6989586621679620617"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620617"><span class="hs-identifier hs-var">bs'</span></a></span></span><span> </span><span id="local-6989586621679620616"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620616"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; Maybe (Word8, ByteString)
</span><a href="../../bytestring/src/Data.ByteString.html#uncons"><span class="hs-identifier hs-var">BS.uncons</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620617"><span class="hs-identifier hs-var">bs'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-81"></span><span>        </span><span class="annot"><span class="annottext">Maybe (Word8, ByteString)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="Distribution.Parsec.FieldLineStream.html#replacementChar"><span class="hs-identifier hs-var">replacementChar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679620655"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620617"><span class="hs-identifier hs-var">bs'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-82"></span><span>        </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679620615"><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620615"><span class="hs-identifier hs-var">cn</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679620614"><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620614"><span class="hs-identifier hs-var">bs1</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-83"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620615"><span class="hs-identifier hs-var">cn</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Word8
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0xC0</span></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Word8 -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Word8
</span><span class="hs-number">0x80</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; ByteString -&gt; Int -&gt; (Char, a)
</span><a href="#local-6989586621679620649"><span class="hs-identifier hs-var">moreBytes</span></a></span><span>
</span><span id="line-84"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620619"><span class="hs-identifier hs-var">byteCount</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-85"></span><span>                </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620618"><span class="hs-identifier hs-var">overlong</span></a></span><span>
</span><span id="line-86"></span><span>                </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620614"><span class="hs-identifier hs-var">bs1</span></a></span><span>
</span><span id="line-87"></span><span>                </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679620616"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; Int -&gt; a
</span><a href="../../base/src/Data.Bits.html#shiftL"><span class="hs-operator hs-var">`shiftL`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">6</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%7C."><span class="hs-operator hs-var">.|.</span></a></span><span> </span><span class="annot"><span class="annottext">Word8 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="../../base/src/GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word8
</span><a href="#local-6989586621679620615"><span class="hs-identifier hs-var">cn</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Bits a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/Data.Bits.html#.%26."><span class="hs-operator hs-var">.&amp;.</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0x3F</span></span><span class="hs-special">)</span><span>
</span><span id="line-88"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char
</span><a href="Distribution.Parsec.FieldLineStream.html#replacementChar"><span class="hs-identifier hs-var">replacementChar</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; a
</span><a href="#local-6989586621679620655"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">ByteString
</span><a href="#local-6989586621679620614"><span class="hs-identifier hs-var">bs1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-89"></span><span>
</span><span id="line-90"></span><span class="annot"><a href="Distribution.Parsec.FieldLineStream.html#replacementChar"><span class="hs-identifier hs-type">replacementChar</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Char</span></span><span>
</span><span id="line-91"></span><span id="replacementChar"><span class="annot"><span class="annottext">replacementChar :: Char
</span><a href="Distribution.Parsec.FieldLineStream.html#replacementChar"><span class="hs-identifier hs-var hs-var">replacementChar</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\xfffd'</span></span><span>
</span><span id="line-92"></span></pre></body></html>